package com.caimiao.miao.page.master.storage;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.caimiao.miao.R;
import com.caimiao.miao.interfaces.BaseFragmentImpl;
import com.caimiao.miao.page.master.MasterActivity;
import com.caimiao.miao.page.master.storage.enter.EnterFragment;
import com.caimiao.miao.page.master.storage.manual.ManualFragment;

public class StorageFragment extends BaseFragmentImpl<IStorageContact.Presenter> implements IStorageContact.View, View.OnClickListener {
    public static final String TAG = StorageFragment.class.getSimpleName();
    private TextView mTvCount;

    @Override
    public int getLayoutRes() {
        return R.layout.fragment_master_storage;
    }

    @Override
    public void initUI() {
        setTitle("仓库管理");
        mTvCount = mRootView.findViewById(R.id.masterStorageTvCount);
    }

    @Override
    public void initLogic() {
        mRootView.findViewById(R.id.masterStorageBtnEnter).setOnClickListener(this::onClick);
        mRootView.findViewById(R.id.masterStorageBtnManualTicket).setOnClickListener(this::onClick);
    }

    @Override
    public void close(Bundle extra) {

    }

    @Override
    public void onClick(View v) {
        MasterActivity activity = (MasterActivity) getActivity();
        switch (v.getId()) {
            case R.id.masterStorageBtnEnter:
                activity.replaceByChild(EnterFragment.class);
                break;
            case R.id.masterStorageBtnManualTicket:
                activity.replaceByChild(ManualFragment.class);
                break;

        }
    }
}
